import Axios from 'axios';

const AXIOS_DEFAULT_CONFIG = {
    baseURL: 'http://localhost:8899/',
    timeout: 20000,
    maxContentLength: 2000,
    headers: {},
};

let axios = Axios.create(AXIOS_DEFAULT_CONFIG);

// axios.interceptors.request.use((request) => {
//     // request.headers['X-AUTH-TOKEN'] = 'customer385d2fafb692417da4a0699f58d4d83e'
//     request.baseURL = config.baseURL;
//     return request;
// });

axios.interceptors.response.use((response) => {
    let res;
    if (response.status === 200) res = response.data;
    return res;
});
export default axios;
